﻿using DAL.Permission;
using Model.Permission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL.Permission
{
    public class RoleAuthorityBLL
    {
        RoleAuthorityDAL dal = new RoleAuthorityDAL();

        /// <summary>
        /// 删除某菜单项的所有授权数据
        /// </summary>
        public bool DeleteByModuleId(int ModuleID)
        {
            return dal.DeleteByModuleId(ModuleID);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool ExistsByUser(int uid, int mid, string tag)
        {
            return dal.ExistsByUser(uid, mid, tag);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int roleid, int mid, string tag)
        {
            return dal.Exists(roleid, mid, tag);
        }

        /// <summary>
        /// 删除数据
        /// </summary>
        public bool Delete(int Roleid, string mtid)
        {
            return dal.Delete(Roleid, mtid);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int RoleAuthorityID)
        {
            return dal.Exists(RoleAuthorityID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(RoleAuthorityEntity model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(RoleAuthorityEntity model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int RoleID)
        {
            return dal.Delete(RoleID);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string RoleAuthorityIDlist)
        {
            return dal.DeleteList(RoleAuthorityIDlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public RoleAuthorityEntity GetModel(int RoleAuthorityID)
        {

            return dal.GetModel(RoleAuthorityID);
        }
    }
}
